home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
auto_cad
/
slot.lsp
< prev
next >
Wrap
Text File
|
1988-07-16
|
2KB
|
43 lines
;***************************************************************************
(defun C:SLOT () ; V1.00
;
; Mike Pillers 22:41:27 7/18/1986
; Machine/ Mechanism Design Consultant
; San Jose, CA (408) 280-7959
;
; Draws a long slot with rounded ends by specifying center point,
; width, overall length, and angle of slot.
;
; Not to be sold or published
; in any form without author's permission.
; May be used freely by individuals.
;
(DEFUN *ERROR* (ST)
(PRINC "error: ")
(PRINC ST)
(TERPRI)
)
(setq c1 (getpoint "Enter CENTER POINT of SLOT: ")
sw (getdist c1 "\nEnter WIDTH of SLOT: ")
sl (getdist c1 "\nEnter LENGTH of SLOT: ")
phi (getangle c1 "\nEnter ANGLE of SLOT: ")
dW (mapcar '- (polar c1 (+ phi (/ pi 2)) (/ sw 2)) c1) ;1/2 width vector
dL (mapcar '- (polar c1 phi (/ (- sl sw) 2)) c1) ;1/2 length vector
v1 (mapcar '+ dL (mapcar '* '(-1 -1) dW)) ; vector frm cen to p1
v3 (mapcar '+ dW dL) ; vector frm cen to p3
p1 (mapcar '+ c1 v1)
p2 (polar c1 phi (/ sl 2))
p3 (mapcar '+ c1 v3)
p4 (mapcar '- c1 v1)
p5 (polar c1 phi (/ sl -2))
p6 (mapcar '- c1 v3)
)
(setvar "cmdecho" 0)
(command "point" c1)
(command "ARC" p1 p2 p3)
(command "line" p3 p4 "")
(command "ARC" p4 p5 p6)
(command "line" p6 p1 "")
)